package com.shujia.source

import org.apache.flink.streaming.api.scala._

object Demo1ListSource {
  def main(args: Array[String]): Unit = {
    val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    /**
      * 1、基于集合构建source --- 有界流
      * 如果读取的数据源是有界流，数据处理完任务结束
      *
      */

    val listDS: DataStream[Int] = env.fromCollection(List(1, 2, 3, 4, 5, 6, 7, 8, 9))

    listDS.filter(i => i % 2 == 1).print()

    env.execute()

  }

}
